package com.sright.bcard.enterprise.dal.dao.impl;

import com.sright.bcard.common.service.share.base.dao.BaseDAOImpl;
import com.sright.bcard.common.service.share.base.dao.BaseMapper;
import com.sright.bcard.common.service.share.dto.page.PageParamRequest;
import com.sright.bcard.enterprise.dal.dao.CompanyDAO;
import com.sright.bcard.enterprise.dal.entity.CompanyDO;
import com.sright.bcard.enterprise.dal.mapper.CompanyDOMapper;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository
public class CompanyDAOImpl extends BaseDAOImpl<CompanyDO> implements CompanyDAO {

    @Resource
    private CompanyDOMapper companyDOMapper;

    @Override
    public int deleteCompany(Long id) {
        return companyDOMapper.deleteCompany(id);
    }

    @Override
    public List<CompanyDO> pageList(PageParamRequest pageParamRequest) {
        return companyDOMapper.pageList(pageParamRequest);
    }

    @Override
    public Integer count(PageParamRequest pageParamRequest) {
        return companyDOMapper.count(pageParamRequest);
    }

    @Override
    public List<CompanyDO> selectByCompanyIdList(List<Long> companyIdList) {
        return companyDOMapper.selectByCompanyIdList(companyIdList);
    }

    @Override
    public List<CompanyDO> selectByEnterpriseId(Long enterpriseId) {
        return companyDOMapper.selectByEnterpriseId(enterpriseId);
    }

    @Override
    protected BaseMapper<CompanyDO> getObjMapper() {
        return companyDOMapper;
    }
}
